
CFLAG=-g -Wall
DIR=.
CFILE:= $(wildcard *.c)
OFILE=$(patsubst %.c,%.o,$(CFILE))
DFILE=$(patsubst %.c,%.d,$(CFILE))
OBJ=$(patsubst %.c,%,$(CFILE))
CC=gcc


$(OBJ):%:%.c
	$(CC) -o $@ $^

.PHONY:ofile
ofile:$(OFILE)
$(OFILE):%.o:%.c
	$(CC) -c -o $@ $<

.PHONY:clean
clean:
	-rm $(OBJ) $(OFILE)

.PHONY:run
run:
	$(DIR)/$(OBJ)

.PHONY:rely
rely:
	$(CC) -MM test.c
	#$(CC) -M test.c

# include print.mk

#export var:=baichen
#unexport var

#export

.PHONY:subsystem
subsystem:
	$(MAKE) -C subdir

.PHONY:test
test:cal.h
	$(CC) -o $@ $^
